package com.qth.valet.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * 公里数价格表
 * @TableName km_price
 */
@TableName(value ="km_price")
@Data
public class KmPrice implements Serializable {
    /**
     * id
     */
    @TableId
    private Integer id;

    /**
     * 里程(km)
     */
    private Integer km;

    /**
     * 白天价格(07:00-21:59)
     */
    private Integer dayPrice;

    /**
     * 晚上价格(22:00-06:59)
     */
    private Integer nightPrice;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        KmPrice other = (KmPrice) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getKm() == null ? other.getKm() == null : this.getKm().equals(other.getKm()))
            && (this.getDayPrice() == null ? other.getDayPrice() == null : this.getDayPrice().equals(other.getDayPrice()))
            && (this.getNightPrice() == null ? other.getNightPrice() == null : this.getNightPrice().equals(other.getNightPrice()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getKm() == null) ? 0 : getKm().hashCode());
        result = prime * result + ((getDayPrice() == null) ? 0 : getDayPrice().hashCode());
        result = prime * result + ((getNightPrice() == null) ? 0 : getNightPrice().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", km=").append(km);
        sb.append(", dayPrice=").append(dayPrice);
        sb.append(", nightPrice=").append(nightPrice);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
